var status = 0;
var ran = 0;
importPackage(Packages.tools.RandomStream);

function start() {
    status = -1;
    action(1, 1, 0);
}

function action(mode, type, selection) {
    if (mode < 0) {
        cm.dispose();
        return;
    } else {
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 0) {
	    ran = Randomizer.rand(0, 13);
            	    cm.gainItem(2430191, -1);
          	    cm.gainItem(5000000 + ran, 1);
	    cm.gainMeso(1000000);
                  cm.sendOk("TeamDBG");
	    cm.dispose();
        }
    }
}